Message box changes direction explicitly upon input change #3730
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@RocketChat/core
Message box does not handle well text consisting of both left-to-right and right-to-left parts. (Arch linux, Chrome version 51.0.2704.84 (Official Build) (64-bit))
Here is the behavior I experience when clicking only the left arrow:
Notice the skip over the space in the middle and the jump to the start right before the end.
After:
It seems to be a bug with how chrome handles
dir="auto"
in textareas (Firefox seems better, but not perfect. Other browsers might have problems too, I did not test).This fix explicitly sets
dir="ltr"
ordir="rtl"
depending on the input.The problem I see with this fix is that now the entire message has the same direction. Ideally each line could have its own direction, but I couldn't a better solution.